home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / titans / star.swf / scripts / DefineSprite_11_mbul / frame_1 / DoAction.as
Text File  |  2010-11-09  |  478b  |  29 lines

  1. speed = -8;
  2. d = 40;
  3. onenterframe = function()
  4. {
  5.    d--;
  6.    if(d > 0)
  7.    {
  8.       dx = _X - s._x;
  9.       dy = _Y - s._y;
  10.       ang = math.atan2(dy,dx);
  11.       xs = speed * math.cos(ang);
  12.       ys = speed * math.sin(ang);
  13.       _rotation = deg(ang);
  14.    }
  15.    _X = _X + xs;
  16.    _Y = _Y + ys;
  17.    if(!r.inv)
  18.    {
  19.       if(hittest(s.z))
  20.       {
  21.          r.hit = 1;
  22.       }
  23.    }
  24.    if(_X < -30 or _Y < -30 or _Y > 430)
  25.    {
  26.       this.removeMovieClip();
  27.    }
  28. };
  29.